<template>
  <div>
    <div class="main">
		<div class="flex_line_c" style="padding: 20px 0; font-weight: bold;border-bottom: 1px solid #ececec;">
			<span class="right">{{allPoint}}</span>
			<span style="color: #333;font-weight: 400;">总积分</span>
		</div>
      <div class="car_list">
        <div style="text-align: center; padding: 20px" v-if="RecordList.length==0">
          暂无明细
        </div>
        <div
          class="list"
          v-for="(item, index) in RecordList"
          :key="index"
          v-else
        >
          <div class="left">
            <div class="le_title" v-html="item.remark"></div>
            <div class="le_time">{{ item.createTime }}</div>
          </div>
          <div class="right" v-if="item.scoreType == '积分获取'">+{{ item.score }}</div>
          <div class="right" v-if="item.scoreType == '积分扣除'">-{{ item.score }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import request from "@/utils/request";

export default {
  data() {
    return {
      RecordList: [],
	  allPoint:0
    };
  },
  created() {
    this.userpointsList();
  },
  methods: {
    userpointsList() {
      request({
        url: "/generator/awardusernairerecord/front/list?naireId="+this.$route.query.row,
        method: "get",
      }).then((response) => {
        console.log(response.list);
		this.allPoint=response.score
        this.RecordList = response.list;
      });
    },
    back() {
      this.$router.go(-1); //返回上一层
    },
  },
};
</script>

<style scoped>
.topheader {
  width: 100%;
  background-color: black;
}
.Theadermain {
  height: 48px;
  display: flex;
  justify-content: space-between;
  color: #fff;
  align-items: center;
  width: 95%;
  margin: 0 auto;
}
.headerimg {
  width: 0.8rem;
  margin-left: 10px;
  transform: rotate(180deg);
}

.list {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #ececec;
}
.le_title {
  font-weight: bold;
}
.le_time {
  color: #aeaeae;
}
.right {
  font-size: 20px;
  color: #f6a15d;
}
</style>